home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9270 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: user1.mnsinc.com!huang
  2. From: huang@mnsinc.com (Szu-Wen Huang)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: Tradition or what?
  5. Date: 9 Mar 1996 00:54:48 GMT
  6. Organization: Monumental Network Systems
  7. Message-ID: <4hqkso$gno@news1.mnsinc.com>
  8. References: <4g0elg$mdr@redstone.interpath.net> <4hpd8a$d70@alterdial.UU.NET> <1996Mar8.153250.115645@kuhub.cc.ukans.edu> <4hqfug$19l@news.interpath.net>
  9. NNTP-Posting-Host: user.mnsinc.com
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Scott McMahan - Softbase Systems (softbase@mercury.interpath.net) wrote:
  13. : anh@kuhub.cc.ukans.edu wrote:
  14. : : Well, I found one good use of magic numbers such as when one needs a 
  15. : : localized temporary buffer of data.
  16. : : Well, if I know the data is always going to be less than 15 or whatever, 
  17. : : there is really no need to use a #define here.
  18.  
  19. : You defeated your own argument!
  20.  
  21. : Suppose you "know" that your buffer is "always" going to be 80
  22. : bytes. Then it changes to 132!
  23.  
  24. Let me join in.  I use magic numbers for states in parsing tables,
  25. and will shoot anybody who suggests I should #define state numbers.
  26. I hope we buried the issue, now that I've given one good place to
  27. use magic numbers instead of #define's.
  28.